
function testPrimitives(viewer){
    var materail = new Cesium.Material({
        fabric : {
            type : 'Color',
            uniforms : {
                color : new Cesium.Color(1, 0, 0, 1)
            }
        }
    });

    var geometry = new Cesium.CylinderGeometry({
        length: 100000,
        topRadius: 50000,
        bottomRadius: 50000,
        slices: 30,
      });

      var m = Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
        Cesium.Cartesian3.fromDegrees(113, 34)), //几何的空间位置
      new Cesium.Cartesian3(0, 0, 0), //几何的x,y,z空间偏移
      new Cesium.Matrix4()); //这个可以选择默认;

    var instances = new Cesium.GeometryInstance({
      geometry: geometry,
      attributes: {
          
      },
      modelMatrix: m,
      id: 'geomid'
    });

    viewer.scene.primitives.add(new Cesium.Primitive({
        geometryInstances: instances,
        appearance: new Cesium.MaterialAppearance({
          material : materail,
          faceForward : true
        }),
        allowPicking: true,
        interleave: true,
        releaseGeometryInstances: true
      }));
}


function testGroundPrimitive(viewer)
{
    var ellipse = new Cesium.EllipseGeometry({
        center: Cesium.Cartesian3.fromDegrees(100, 35),
        semiMajorAxis: 500000.0,
        semiMinorAxis: 300000.0,
        rotation: Cesium.Math.toRadians(60.0)
    });
    
    var instance = new Cesium.GeometryInstance({
        geometry: ellipse,
        id: 'geomid'
    });

    var materail = new Cesium.Material({
    fabric : {
        type : 'Color',
        uniforms : {
            color : new Cesium.Color(1, 0, 1, 1)
        }
    }
    });

    viewer.scene.groundPrimitives.add(new Cesium.Primitive({
        geometryInstances: instance,
        appearance: new Cesium.MaterialAppearance({
            material: materail,
            faceForward: true
        }),
        allowPicking: true,
        interleave: true,
        releaseGeometryInstances: true
    }));

    console.log(viewer.scene.lastRenderTime);
}